package com.yuqing.myblogServe.common.lang;

import com.github.pagehelper.PageInfo;

import java.util.List;

/**
 * @author lyq
 * @date 2023/12/9
 **/
public class PageBuilder {
    private PageBuilder() {
    }

    public static <T> PageBean<T> build(List<T> list) {
        PageInfo<T> pageInfo = new PageInfo(list);
        return PageBean.of((long)pageInfo.getPageNum(), (long)pageInfo.getPageSize(), pageInfo.getTotal(), pageInfo.getList());
    }
}
